import request from "../../utils/request.js"
const state = {
	IndexData:{},
}
const mutations = {
	SAVE_INDEXDATA(state,IndexData){
		state.IndexData=IndexData
	},
}
const actions = {
	//获取主页的数据
	async getIndexData({commit}){
		const result=await request('/getIndexData')
		// console.log('home_result',result);
		commit('SAVE_INDEXDATA',result)
	}
}
const getters = {
	indexList(state){
		return state.IndexData.list || []
	}
}
export default {
	state,
	mutations,
	actions,
	getters
}